#include <iostream>

using namespace std;

//打印int整型数在二进制下各个位上的值
void print(int num)
{
    for (int i = 31; i >= 0; i--)
    {
        int temp = (num & (1 << i)) == 0 ? 0 : 1;
        cout << temp;
    }
    cout << endl;
}

int main()
{
    int num = 123456;
    print(num);
    system("pause");
    return 0;
}